﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using DAO;
using DTO;
namespace BUS
{
    public class PhieuDatComBUS
    {
        PhieuDatComDAO pdcDAO = new PhieuDatComDAO();

        public DataSet LayDanhSachPhieuDatComBUS()
        {
            return pdcDAO.XemDanhSachPhieuDatComDAO();
        }
        public List<PhieuDatComDTO> XemDanhSacPhieuDatCom_DirtyRead(int flag)
        {
            PhieuDatComDAO pdcDAO = new PhieuDatComDAO();
            return pdcDAO.XemDanhSacPhieuDatCom_DirtyRead(flag);
        }
        public String ThemPhieuDatCom_DirtyRead(PhieuDatComDTO pdcDTO, int flag, int makhuyenmai)
        {
            PhieuDatComDAO pdcDAO = new PhieuDatComDAO();
            return pdcDAO.ThemPhieuDatCom_DirtyRead(pdcDTO, flag, makhuyenmai);
        }
        public String ThemPhieuDatCom_LostUpdate(PhieuDatComDTO pdcDTO, int flag)
        {
            PhieuDatComDAO pdcDAO = new PhieuDatComDAO();
            return pdcDAO.ThemPhieuDatCom_LostUpdate(pdcDTO, flag);
        }
        public DateTime LayKhuyenMai(int ma)
        {
            return pdcDAO.LayNgayBatDauKhuyenMai(ma);
        }
        public int LayKhoiLuongMonAn(int mamonan)
        {
            return pdcDAO.LayKhoiLuongMonAn(mamonan);
        }
        public int LayKhoiLuongTonMonAn(int mamonan)
        {
            return pdcDAO.LayKhoiLuongTonMonAn(mamonan);
        }
        public int LayMaPhieuDatComMax()
        {
            return pdcDAO.LayMaPhieuDatComMax();
        }
        public int TinhSoLuongTon(int ma)
        {
            return pdcDAO.TinhSoLuongTon(ma);
        }
    }
}
